class People:
    def __init__(self, name, age):
        self.name =name
        self.age = age

    def wark(self, speed):
        # 人类的走方法
        print("%d岁的%s正在以%d米每秒的速度行走" % (self.age, self.name ,speed))

#学生类，继承自人类
class Student(People):
        #学习方法
        def study(self, sub):
            print("%d岁的%s正在学习%s" % (self.age, self.name ,sub))

#教师类，继承自学生类
class Teacher(Student):
    #教方法
    def teach(self, sub):
        print("%d岁的%s正在教%s" % (self.age, self.name, sub))

if __name__ == "__main__":
    p = People('张三', 20)
    p.wark(3)
    stu = Student('李四', 25)
    stu.wark(5)
    stu.study('Python')
    tea = Teacher('王五', 30)
    tea.wark(4)
    tea.study("教育理论")
    tea.teach('java')